############## MySQL 数据库 #####################
FROM mysql:5.7
MAINTAINER biebbwa@163.com
RUN chmod +x /usr/local/bin/docker-entrypoint.sh
ARG MYSQL_USER
ARG MYSQL_PWD
COPY init/init.sql /docker-entrypoint-initdb.d/init.sql
COPY sql/db_hk4e_config_gio.sql /opt/sql/
COPY sql/db_hk4e_deploy_config_gio.sql /opt/sql/db_hk4e_deploy_config_gio.sql
COPY sql/db_hk4e_order_gio.sql /opt/sql/db_hk4e_order_gio.sql
COPY sql/db_hk4e_user_gio.sql /opt/sql/db_hk4e_user_gio.sql
COPY sql/db_hk4e_config_gio.sql /opt/sql/db_hk4e_config_gio.sql
RUN chown -R mysql:mysql /docker-entrypoint-initdb.d/ && \
    chown -R mysql:mysql /opt/sql/ && \
    sed -i "s/MYSQL_USER/$MYSQL_USER/g" /docker-entrypoint-initdb.d/init.sql && \
    sed -i "s/MYSQL_PWD/$MYSQL_PWD/g"  /docker-entrypoint-initdb.d/init.sql